package com.oop.QuickHit;

import java.util.Scanner;

import org.apache.log4j.chainsaw.Main;

public class Player {

	private int levelNo;// 玩家当前级别号
	private int currScore;// 玩家当前级别积分
	private long startTime;// 当前级别开始时间
	private int elapsedTime;// 当前级别已用时间

	public int getLevelNo() {
		return levelNo;
	}

	public void setLevelNo(int levelNo) {
		this.levelNo = levelNo;
	}

	public int getCurrScore() {
		return currScore;
	}

	public void setCurrScore(int currScore) {
		this.currScore = currScore;
	}

	public long getStartTime() {
		return startTime;
	}

	public void setStartTime(long startTime) {
		this.startTime = startTime;
	}

	public int getElapsedTime() {
		return elapsedTime;
	}

	public void setElapsedTime(int elapsedTime) {
		this.elapsedTime = elapsedTime;
	}

	public void play() {// 玩游戏
		Game game = new Game(this);// this--->指当前对象的引用，传入的值是当前Player类(现在没创建对象)以后创建对象的引用
		Scanner input = new Scanner(System.in);

		for (int j = 0; j < LevelParam.LEVEL.length; j++) {
			// 等级加1
			this.levelNo += 1;
			// 积分清0
			this.currScore = 0;
			// 计时重新开始
			this.startTime = System.currentTimeMillis();

			for (int k = 0; k < LevelParam.LEVEL[this.levelNo - 1].getStrTimes(); k++) {
				System.out.println("游戏开始!请输入下列字符串：");
				String out = game.printStr();
				String in = input.next();
				game.printResult(out, in);
			}
		}
	}

	public static void main(String[] args) {
		Player play = new Player();
		play.play();
	}
}
